//
//  RequestManager.h
//  OrderFood
//
//  Created by xiaofang wang on 2018/10/26.
//  Copyright © 2018年 zhiyuan. All rights reserved.
//

#import <Foundation/Foundation.h>

#define NetWork     [RequestManager sharedManager]

NS_ASSUME_NONNULL_BEGIN

@interface RequestManager : NSObject

typedef void(^SuccessBlock)(NSDictionary *response); // 成功回调
typedef void(^FailureBlock)(NSString     *message);  // 失败回调
/// 网络管理
+ (instancetype)sharedManager;

- (void)netGet:(NSString *)url data:(NSDictionary *)data success:(SuccessBlock)success failure:(FailureBlock)failure;

- (void)netPost:(NSString *)url data:(NSDictionary *)data success:(SuccessBlock)success failure:(FailureBlock)failure;


- (NSString *)authorizationWithToken:(NSString *)token apiStr:(NSString *)api timeStamp:(NSString *)timeStamp;
- (NSString *)signatureWithAPI:(NSString *)api timeStamp:(NSString *)timeStamp;
- (NSString *)getNowTime;
- (NSString *)pureStrWithOriginStr:(NSString *)originStr;
- (NSString *)rb_jsonStrFromDic:(NSDictionary *)dic;

-(BOOL)isConnectNetWork;
@end

NS_ASSUME_NONNULL_END
